<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    h2{
      text-align: center;
    }
    table{
      margin: 0 auto;
    }
    table,
    td,
    th
    {
      border: 1px solid #333;
      border-collapse: collapse;
      text-align: center;
    }
  </style>
</head>
<body>

  <h2>12月份消费支出明细</h2>
  <script>
    let total = prompt('银行卡总金额')
    let shui = prompt('本月水费')
    let dian = prompt('本月电费')
    let wang = prompt('本月网费')
    const money = total-shui-dian-wang
    document.write(`
    <table>
    <tr>
      <th>银行卡总额</th>
      <th>本月水费</th>
      <th>本月电费</th>
      <th>本月网费</th>
      <th>银行卡余额</th>
      <tr>
        <td>${total}</td>
        <td>${shui}</td>
        <td>${dian}</td>
        <td>${wang}</td>
        <td>${money}</td>
      </tr>
    </tr>

  </table>
    `)

  </script>
</body>
</html>